/* eslint-disable no-return-assign */
/* eslint-disable no-unused-vars */
/* eslint-disable prefer-const */
<template>
  <page-header-wrapper>
    <div>
      <a-card :bordered="false" v-show="disvisible">
        <a-icon :type="collapsed ? 'menu-unfold' : 'menu-fold'" @click="turnSmall" class="turnSmall"></a-icon>
        <div class="scroll">
          <a-row :gutter="3">
            <a-col :span="treespan">
              <div class="scroll-interior">
                <s-tree
                  :dataSource="orgTree"
                  :openKeys="openKeys"
                  :search="false"
                  @click="handleClick"
                  @titleClick="handleTitleClick"
                  :selectKey="defaultSelectKey"
                >
                </s-tree> 
              </div>
            </a-col>
            <a-col :span="tablespan">
              <a-button v-if="this.optionjugde === 'notverify'" type="primary" @click="addargument" style="margin:5px">
                添加论证
              </a-button>
              <label style="margin:5px">年度:</label>
              <a-range-picker @change="onChangeday" style="margin:5px" :format="dateFormat" />
              <a-input-search
                placeholder="输入您要搜索的内容"
                @search="onSearch"
                style="width:25%; margin:5px"
                v-model="search"
                enter-button
              />
              <a-table
                ref="table"
                :loading="loading"
                :columns="columns"
                :scroll="{ x: 1400 }"
                :rowClassName="rowClassName"
                :row-key="record => record.argument_id"
                :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, rowSelection: rowSelection }"
                :pagination="pagination"
                :data-source="dataSource"
                @change="handleTableChange"
                :alert="false"
                bordered
              >
                <span slot="status" slot-scope="status">
                  <a-tag color="blue">
                    {{ status }}
                  </a-tag>
                </span>
                <template slot="action" slot-scope="text, record">
                  <div>
                    <span v-if="record.status === '未审核'||record.status === '审核不通过'">
                      <a @click="handleModalData(record)">详情</a>
                    </span>
                    <span v-else>
                      <div style="text-align: left">
                        <a v-show="createPassShow" @click="createPass(record)">抽取密码</a>
                        <a-divider v-show="createPassShow" type="vertical"></a-divider>
                        <span v-if="record.expert_status==='first'">
                          <a @click="handlereportexp(record)">专家抽取</a>
                        </span>
                        <span v-if="record.expert_status==='second'">
                          <a @click="handlereportexp(record)">初次完成</a>
                        </span>
                        <span v-if="record.expert_status==='third'">
                          <a @click="handlereportexp(record)">最终完成</a>
                        </span>
                        <a-divider type="vertical"></a-divider>
                        <a @click="transmit(record)">生成二维码</a>
                        <br/>
                        <a @click="parameters(record)">方案参数</a>
                        <a-divider type="vertical"></a-divider>
                        <a @click="handlereportData(record)">论证报告</a>
                        <a-divider type="vertical"></a-divider>
                        <a @click="handleModalData(record)">&nbsp;&nbsp;&nbsp;&nbsp;详情</a>
                      </div>
                    </span>
                  </div>
                </template>
                <template slot="titlename">{{ titlename }}</template>
              </a-table>
              <a-button type="primary" :disabled="!hasSelected" :loading="loading" @click="deletemess">
                删除
              </a-button>
              <span style="margin-left: 8px">
                <template v-if="hasSelected">
                  {{ `Selected ${selectedRowKeys.length} items` }}
                </template>
              </span>
            </a-col>
          </a-row>
        </div>
        <a-modal
          title="生成密码"
          :visible="createVisible"
          okText="复制密码"
          @cancel="createCancel"
          @ok="createOk"
          v-if="createVisible"
          width="45%"
          :maskClosable="false"
        >
          <h3 style="text-align: center">{{ code }}</h3>
          <h3 style="text-align: center">工程名称：{{ project_namevalue }}</h3>
          <h3 style="text-align: center">联系人电话：{{ phonevalue }}</h3>
        </a-modal>
        <!-- <a-modal v-model="QRcodevisible" title="扫描二维码了解更多" style="width:300px" align="center">
        </a-modal> -->
        <a-modal
          v-model="QRcodevisible"
          title="提示"
          ok-text="确认"
          cancel-text="取消"
          @ok="qrcodemodel"
          width="42%"
        >
          <div style="width:700px;font-size:20px;margin-left:45px;color:black;font-weight:550">危大工程方案管理</div>
          <div class="body">
            <div class="erweima" style="display:flex;margin-left:18px;width:220px" id="qrcode" ref="qrcode"></div>
            <div class="add">
              <span style="font-weight:540;font-size:24px;color:black;width:320px">论证名称：{{ aproject_name }}</span>
              <span style="font-weight:normal;font-size:24px;color:black;width:500px">论证类型：{{ aclassic_name }}</span>
              <span style="font-weight:normal;font-size:24px;color:black;width:500px">承建单位：{{ abulid_unit }}</span>
            </div>
          </div>
        </a-modal>
        <!-- 添加论证 -->
        <a-modal
          :visible="visible"
          :title="dialogTitle"
          @cancel="handleModalClose"
          okText="保存"
          cancelText="取消"
          v-if="visible"
        >
          <a-form-model
            ref="argumentmessage"
            :model="argumentmessage"
            :label-col="{span: 5}"
            :wrapper-col="{span: 16}"
            :rules="rules"
          >
            <a-form-model-item label="论证编号" prop="argument_num">
              <a-input v-model="argumentmessage.argument_num"></a-input>
            </a-form-model-item>
            <a-form-model-item label="联系人" prop="people_name">
              <a-input v-model="argumentmessage.people_name" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="联系电话" prop="phone">
              <a-input v-model.number="argumentmessage.phone" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="论证名称" prop="isProject_name" v-show="isRoleId == 'itemRegistration'?true:false">
              <a-input :placeholder="isProjectName" v-model="argumentmessage.project_name" :disabled="isRoleId == 'itemRegistration'?true:false"></a-input>
            </a-form-model-item>
            <a-form-model-item label="论证名称" prop="project_name" v-show="isRoleId !== 'itemRegistration'?true:false">
              <a-input v-model="argumentmessage.project_name" :disabled="isRoleId == 'itemRegistration'?true:false"></a-input>
            </a-form-model-item>

            <!-- 工程类别定义 -->
            <a-form-model-item 
              label="工程类别"
              prop="category_id"
            >
              <a-select @change="changecategory" default-value="超过一定规模危大工程" placeholder="请选择工程类别" v-model="argumentmessage.category_id">
                <template v-for="(protype,index3) in categorykind">
                  <a-select-option :key="index3" :value="protype.category_id">
                    {{ protype.category_name }}
                  </a-select-option>
                </template>
              </a-select>
              <!-- <a-select default-value="超过一定规模危大工程" @change="changecategory =>(index)" v-model="argumentmessage.category_id">
                <a-select-option value="超过一定规模危大工程">
                  超过一定规模危大工程
                </a-select-option>
                <a-select-option value="危大工程">
                  危大工程
                </a-select-option>
                <a-select-option value="普通工程">
                  普通工程
                </a-select-option>
              </a-select> -->
            </a-form-model-item>
            
            <a-form-model-item label="建设单位" prop="construction_unit">
              <a-input v-model="argumentmessage.construction_unit" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="监理公司" prop="supervision_unit">
              <a-input v-model="argumentmessage.supervision_unit" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="承建单位" prop="bulid_unit">
              <a-input v-model="argumentmessage.bulid_unit" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="工程地址" prop="project_site">
              <a-input v-model="argumentmessage.project_site" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="委托日期" prop="entrust_time">
              <a-date-picker v-model="argumentmessage.entrust_time" />
            </a-form-model-item>
          </a-form-model>
          <template slot="footer">
            <Button type="button" class="ant-btn ant-btn-primary" @click="handleModalOk" :disabled="confirmLoading">保存</Button>
            <Button type="button" class="ant-btn ant-btn-primary" v-if="savestatus&&this.optionjugde === 'notverify'" @click="adopt" :disabled="refusebutton">通过</Button>
            <Button type="button" class="ant-btn ant-btn-danger" v-if="savestatus&&this.optionjugde === 'notverify'" @click="refuse" :disabled="refusebutton">拒绝</Button>
            <Button type="button" class="ant-btn" @click="handleModalClose">取消</Button>
          </template>
        </a-modal>
        <a-modal
          v-if="reportvisible"
          :visible="reportvisible"
          @cancel="handlereportClose"
          @ok="handlereportOk"
          title="论证报告"
          :confirm-loading="confirmLoadingreport"
          okText="保存"
          cancelText="取消"
        >
          <a-form-model
            ref="argumentreport"
            :model="argumentreport"
            :label-col="{span: 5}"
            :wrapper-col="{span: 16}"
            :rules="rules"
          >
            <a-form-model-item label="论证日期" >
              <a-date-picker
                placeholder="选择日期"
                v-model="argumentreport.create_time"
                :format="dateFormat"
              />
              <a href="https://society-upload.oss-cn-shenzhen.aliyuncs.com/argumnet_model_file/argument_mode.doc" style="margin-left:180px;">{{ '论证报告（模板）' }}</a>
            </a-form-model-item>
            <a-form-model-item label="论证结论" prop="" >
              <a-select v-model="argumentreport.status">
                <a-select-option value="通过" >
                  通过
                </a-select-option>
                <a-select-option value="修改后通过">
                  修改后通过
                </a-select-option>
                <a-select-option value="拒绝">
                  拒绝
                </a-select-option>
              </a-select>
            </a-form-model-item>
            <a-form-model-item label="论证报告上传（PDF）" prop="" style="margin-bottom: 0px;">
              <a-upload
                name="file"
                :file-list="fileList"
                :multiple="false"
                :remove="handleRemove"
                @change="(info) => {handleUploadChange(info)}"
                accept=".pdf"
                :custom-request="handleUpload"
              >
                <a-button>
                  <a-icon type="upload" /> 上传文件 </a-button>
              </a-upload>
            </a-form-model-item>
            <!-- <a-form-model-item label="论证现场图片上传" prop="">
              <template>
                <a-upload
                  name="avatar"
                  list-type="picture-card"
                  class="avatar-uploader"
                  :show-upload-list="false"
                  :before-upload="beforeUploadPdf"
                  @change="handleChange"
                >
                  <img v-if="imageUrl" :src="imageUrl" alt="avatar" />
                  <div v-else>
                    <a-icon :type="loading ? 'loading' : 'plus'" />
                    <div class="ant-upload-text">
                      上传图片
                    </div>
                  </div>
                </a-upload>
              </template>
            </a-form-model-item> -->
            <a-form-model-item label="备注">
              <a-input v-model="argumentreport.report_desc" ></a-input>
            </a-form-model-item>
          </a-form-model>
        </a-modal>
      </a-card>
      <a-card v-show="!disvisible">
        <a-modal
          :visible="extractvisible"
          v-if="extractvisible"
          @cancel="handleExtractClose()"
          @ok="handleExtractOk()"
          title="专家抽取"
          :confirm-loading="extractLoading"
          okText="抽取"
          cancelText="取消"
          width="55%"
        >
          <a-form-model
            ref="extractionrules"
            :label-col="{span: 6}"
            :wrapper-col="{span: 17}"
            :model="extractionrules"
          >
            <a-divider>抽取条件</a-divider>
            <a-form-model-item
              v-for="(item, index) in extractionrules.extract_rules"
              :key="index"
              :label="item.rule_name"
              :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }"
              :rules="[{ required: item.required, message: '内容不可为空', trigger: 'blur' }]"
              :prop="'extract_rules.' + index + '.rule_value'"
            >
              <!-- <a-input
                v-if="item.rule_type==1"
                v-model="item.rule_value"
              /> -->
              <a-input-number v-if="item.rule_type==1" id="inputNumber" v-model="item.rule_value" :min="0" :disabled="item.is_open == '0' && isRoleId !== 'admin'?true:false"/>
              <a style="color: red;margin-left: 1.5%">
                {{ item.note }}
              </a>
              <a-select v-if="item.rule_type==2" @change="changeDefaultExtract(index,$event)">
                <template v-for="(itemtype,index2) in experttype">
                  <a-select-option :key="index2" :value="itemtype.type_name">
                    {{ itemtype.type_name }}
                  </a-select-option>
                </template>
              </a-select>
              <template>
                <a-checkbox @change="onChangeBoxTwo" v-if="item.rule_type==3" :value="item.rule_id" :clearable="true" :checked="item.checked"> 选择 </a-checkbox>
              </template>
            </a-form-model-item>
            <!-- <a-text style="color: red;margin-left: 1.5%">
              {{ extractionrules.note }}
            </a-text> -->
            <br/>
            <a-divider>回避条件</a-divider>
            <a-form-model-item
              v-for="item in extractionrules.avoid_rules"
              :key="item.rule_id"
              :label="item.rule_name"
              :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }"
            >
              <a-input
                v-if="item.rule_type==1"
                v-model="item.rule_value"
                style="width:calc(80%);float: left"
              />
              <template>
                <a-checkbox
                  style="margin-left: 2%"
                  @change="onChangeBoxAvoid"
                  v-if="item.rule_type==1"
                  :value="item.rule_id"
                  :checked="item.checked"
                >
                  选择
                </a-checkbox>
              </template>
              <template>
                <a-checkbox
                  @change="onChangeBoxOne"
                  v-if="item.rule_type==2"
                  :value="item.rule_id"
                  :checked="item.rule_value"
                >
                  选择
                </a-checkbox>
              </template>
              <a-select v-if="item.rule_type==3" default-value="" @change="changeDefaultAvoid(index,$event)" style="width:calc(80%);float: left">
                <template v-for="(itemunittype,index) in exunit">
                  <a-select-option :key="index" :value="itemunittype.name">
                    {{ itemunittype.value }}
                  </a-select-option>
                </template>
              </a-select>
              <template>
                <a-checkbox
                  style="margin-left: 2%"
                  @change="onChangeBoxAvoid"
                  v-if="item.rule_type==3"
                  :value="item.rule_id"
                  :checked="item.checked"
                >
                  选择
                </a-checkbox>
              </template>
            </a-form-model-item>
          </a-form-model>
        </a-modal>
        <h3>
          <span class="title_h">
            工程名称:
          </span>
          <span class="title_d">{{ projectname }}</span>
        </h3>
        <h3>
          <span class="title_h">
            论证编号:
          </span>
          <span class="title_d">{{ projectnumber }}</span>
        </h3>
        <a-button style="margin:5px" @click="back">
          <a-icon type="rollback" />返回
        </a-button>
        <br/>
        <a-modal
          v-model="randomextract_switch"
          title="提示"
          ok-text="确认"
          cancel-text="取消"
          @ok="randomextract_yes"
        >
          <p style="color:red;display:flex;justify-content:center ;">请先与协会管理员联系获取抽取密码</p>
        </a-modal>
        <a-modal
          v-model="owner_switch"
          title="提示"
          ok-text="确认"
          cancel-text="取消"
          @ok="owner_yes"
        >
          <p style="color:red;display:flex;justify-content:center ;">请确认是否最终完成，点击后按钮失效</p>
        </a-modal>
        <a-button style="margin:5px" @click="randomextract" :disabled="this.review">专家抽取</a-button>
        <a-button style="margin:5px" @click="manualextract" :disabled="this.handspun_state" >手工抽取</a-button>
        <a-button style="margin:5px" :disabled="!posthasSelected&&!alterhasSelected||this.review" @click="audit(1)">审核</a-button><!-- 表单长度小于零，禁用图标 -->
        <a-button style="margin:5px" :disabled="!posthasSelected&&!alterhasSelected||isRoleId !== 'admin'||this.review" @click="audit(2)">流号</a-button>
        <a-button style="margin:5px" :disabled="!posthasSelected&&!alterhasSelected||isRoleId !== 'admin'||this.review" @click="audit(3)">删除</a-button>
        <a-button style="float:right" v-if="isRoleId == 'admin'" @click="owner" :disabled="this.experts_merger||this.review" >最终完成</a-button>
        <a-button style="float:right" v-if="isRoleId == 'itemRegistration'" @click="extraction" :disabled="this.review_one">抽取完成</a-button>
        <p class="size_p">正选列表</p>
        <a-table
          :loading="positiveloading"
          :columns="positivecolumns"
          :row-selection="{ selectedRowKeys: selectedpositiveKeys, onChange: onpositiveChange, rowSelection: positiveSelection }"
          :pagination="positivepagination"
          :data-source="positivedataSource"
          :row-key="record => record.experts_id"
          bordered
        >
          <span slot="audit_status" slot-scope="audit_status">
            <a-tag color="blue">
              {{ audit_status }}
            </a-tag>
          </span>
          <template slot="positiveaction" slot-scope="text, record">
            <a @click="handlepositive(record)">详情</a>
          </template>
        </a-table>
        <p class="size_h">备选列表</p>
        <a-table
          :loading="alternativeloading"
          :columns="alternativecolumns"
          :row-selection="{ selectedRowKeys: selectedalternativeKeys, onChange: onalternativeChange, rowSelection: alternativeSelection }"
          :pagination="alternativepagination"
          :data-source="alternativedataSource"
          :row-key="record => record.experts_id"
          bordered
        >
          <span slot="audit_status" slot-scope="audit_status">
            <a-tag color="blue">
              {{ audit_status }}
            </a-tag>
          </span>
          <template slot="alternativeaction" slot-scope="text, record">
            <a @click="handlealternative(record)">详情</a>
          </template>
        </a-table>
        <a-modal
          title="输入抽取密码"
          :visible="passwordVisible"
          okText="确定"
          @cancel="passwordCancel"
          @ok="passwordOk"
          v-if="passwordVisible"
          width="45%"
          :maskClosable="false"
        >
          <a-form-model ref="pass" :model="pass" :label-col="{span: 7}" :wrapper-col="{span: 10}" :rules="{inputPassword: [{ required: true, message: '内容不可为空' }]}">
            <a-form-model-item label="抽取密码" prop="inputPassword">
              <a-input v-model="pass.inputPassword"></a-input>
            </a-form-model-item>
          </a-form-model>
        </a-modal>
        <a-modal
          title="专家详情"
          :visible="expertvisible"
          @cancel="detailsCancel"
          v-if="expertvisible"
          width="45%"
        >
          <a-form-model :model="expertmessage" :label-col="{span: 7}" :wrapper-col="{span: 16} ">
            <a-form-model-item label="专家姓名" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-input v-model="expertmessage.username"></a-input>
            </a-form-model-item>
            <a-form-model-item label="专家身份证号码" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-input v-model="expertmessage.card_num" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="专家性别" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-input v-model="expertmessage.sex" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="专家所属单位" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-input v-model="expertmessage.company_name"></a-input>
            </a-form-model-item>
            <a-form-model-item label="专家手机号码" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-input v-model="expertmessage.phone" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="专家职称" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-input v-model="expertmessage.experts_title" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="职称专业" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-input v-model="expertmessage.title_major" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="专业资格" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-input v-model="expertmessage.major_status" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="专家论证类别" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-select mode="multiple" style="width: 100%" v-model="expertmessage.experts_types"></a-select>
            </a-form-model-item>
            <a-form-model-item label="专家级别" prop="experts_level" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-input v-model="expertmessage.experts_level" ></a-input>
            </a-form-model-item>
            <a-form-model-item label="本人证件照" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-upload
                :file-list="expertmessage.my_photo"
                @preview="handlePreview"
                list-type="picture-card"
              ></a-upload>
            </a-form-model-item>
            <a-form-model-item label="身份证文件" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-upload
                :file-list="expertmessage.my_card_photo"
                @preview="handlePreview"
                list-type="picture-card"
              ></a-upload>
            </a-form-model-item>
            <a-form-model-item label="学历证明文件" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-upload
                :file-list="expertmessage.academic_credentials"
                @preview="handlePreview"
                list-type="picture-card"
              ></a-upload>
            </a-form-model-item>
            <a-form-model-item label="职称文件" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-upload
                :file-list="expertmessage.title_document"
                @preview="handlePreview"
                list-type="picture-card"
              ></a-upload>
            </a-form-model-item>
            <a-form-model-item label="执业资格文件" prop="" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-upload
                :file-list="expertmessage.practice_qualification_certificate"
                @preview="handlePreview"
                list-type="picture-card"
              ></a-upload>
            </a-form-model-item>
            <a-form-model-item label="备注" prop="remarks" :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
              <a-input v-model="expertmessage.remarks" ></a-input>
            </a-form-model-item>
          </a-form-model>
          <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancelimg">
            <img alt="example" style="width: 100%" :src="previewImage" />
          </a-modal>
          <template slot="footer">
            <Button type="button" class="ant-btn" @click="detailsCancel">取消</Button>
          </template>
          <a-divider>历史参与工程</a-divider>
          <a-table :columns="expertcolumns" :data-source="expertdataSource" :pagination="false" bordered></a-table>
        </a-modal>
        <a-modal :visible="manualvisible" @cancel="manualCancel" width="55%">
          <a-button type="primary" :disabled="!manualSelected" :loading="manualloading" style="margin-top:33px " @click="manualadd">
            添加
          </a-button>
          <a-input-search
            placeholder="输入您要搜索的内容"
            @search="onSearchmanual"
            style="width:25%;float:right;margin-top:33px"
            v-model="searchmanual"
            enter-button
          />
          <a-table
            style="margin-top:12px"
            :loading="manualloading"
            :columns="manualcolumns"
            :row-selection="{ selectedRowKeys: selectedmanualKeys, onChange: onmanualChange, rowSelection: manualSelection }"
            :pagination="manualpagination"
            :data-source="manualdataSource"
            :row-key="record => record.experts_id"
            bordered
            @change="handleTableChangemanual"
          >
            <template slot="manualaction" slot-scope="text, record">
              <a @click="handlemanual(record)">详情</a>
            </template>
          </a-table>
          <template slot="footer">
            <a-button @click="manualCancel">关闭</a-button>
          </template>
        </a-modal>
        <a-modal
          v-model="extracts"
          title="已审核专家名单"
          ok-text="确认"
          cancel-text="取消"
          @ok="complete"
          width="45%"
        >
          <p class="size_p">正选列表</p>
          <a-table
            :columns="exportlist"
            :data-source="ApprovedList_real"
            bordered
          >
          </a-table>
          <p class="size_h">备选列表</p>
          <a-table
            :columns="exportlist"
            :data-source="ApprovedList_optional"
            bordered
          >
          </a-table>
        </a-modal>
        <a-modal
          v-model="extracts_end"
          title="提示"
          ok-text="确认"
          cancel-text="取消"
          @ok="complete_end"
        >
          <p style="color:red;display:flex;justify-content:center ;">请注意点击确定后,将不能再修改抽取名单,请确认后再点击按钮</p>
        </a-modal>
      </a-card>
      
      <a-modal
        v-model="programmevisible"
        title="方案参数"
        ok-text="确认"
        cancel-text="取消"
        @ok="programmeModelOk"
      >
        <a-button class="editable-add-btn" style="margin-bottom: 8px" @click="isAdd()">新增</a-button>
        <a-table
          ref="table"
          size="default"
          :pagination="false"
          :columns="columns1"
          :dataSource="dataSource1"
          :row-key="(record,index)=>{return index}"
        >
          <template slot="argument_insert_name" slot-scope="text, record, index">
            <a-input
              v-if="record.isinput"
              style="margin: -5px 0"
              :value="text"
              v-model="record.argument_insert_name"
              @change="(e) => handleChangeIndex(e.target.value, index,'argument_insert_name','dataSource1')"
            />
            <template v-else>{{ text }}</template>
          </template>

          <template slot="argument_insert_value" slot-scope="text, record, index">
            <a-input
              v-if="record.isinput"
              style="margin: -5px 0"
              :value="text"
              v-model="record.argument_insert_value"
              placeholder="请编辑内容"
              @change="(e) => handleChangeIndex(e.target.value, index,'argument_insert_value','dataSource1')"
            />
            <template v-else>{{ text }}</template>
          </template>


          <template slot="argument_insert_action" slot-scope="text, record, index">
            <div class="editable-row-operations">
              <span v-if="record.isinput">
                <a @click="saveRowIndex(index)">保存</a>&nbsp;
                <a-popconfirm title="确定取消吗?" @confirm="() => cancelIndex( index)">
                  <a>取消</a>
                </a-popconfirm>
              </span>
              <span v-else>
                <a @click="() => editRowIndex(index)">编辑</a>&nbsp;
                <a-popconfirm title="确定删除吗?" @confirm="() => delRowIndex(index)">
                  <a>删除</a>
                </a-popconfirm>
              </span>
            </div>
          </template>
            
        </a-table>

      </a-modal>
      
    </div>
  </page-header-wrapper>
</template>

<script>
import STree from '@/components/Tree/Tree'
import OrgModal from '../other/modules/OrgModal'
import { mapState } from 'vuex' // 引入mapstate辅助函数
import QRCode from 'qrcodejs2'
// import $ from 'jquery'
// import Vue from 'vue'
// import { Modal } from 'ant-design-vue'
import { menuFinds, getargumentlist, addargumentmess, saveargumentmess, agrumentdelete, agrusearch, addreport, modstatus, getreport, getentrusttime, auditedexpert, addparameter,getparameter,categorytype } from '@/api/programDiscuss'
import { sendpdf } from '@/api/report'
// eslint-disable-next-line no-unused-vars
import { getxtractionrules, getexperttype, extractunit, extract, operateextract, getauditmess, gethandmess, manualsearch, createCode, usePassword, preExtract, changexpert } from '@/api/expertextraction'
import moment from 'moment'
import { cloneDeep } from 'lodash-es'
// import { defineComponent, reactive, Ref } from 'vue'
import { UnwrapRef } from 'vue'


const delay = (function () {
 let timer = 0
 return function (callback, ms) {
  clearTimeout(timer)
  timer = setTimeout(callback, ms)
 }
})()
function getBase64 (file) {
  return new Promise((resolve, reject) => {
    const reader = new FileReader()
    reader.readAsDataURL(file)
    reader.onload = () => resolve(reader.result)
    reader.onerror = error => reject(error)
  })
}
export default  ({
  name: 'TreeList',
  inject: ['reload'],
  components: {
    STree,
    OrgModal,
    QRCode
    // $
  },
  data () {
    return {
      category_id:0,
      dataSource1:[],
      columns1: [
        {
          title: '字段名',
          dataIndex: 'argument_insert_name',
          key: 'argument_insert_name',
          scopedSlots: { customRender: 'argument_insert_name' }
        },
        {
          title: '值',
          dataIndex: 'argument_insert_value',
          key: 'argument_insert_value',
          scopedSlots: { customRender: 'argument_insert_value' }
        },
        {
          title: '操作',
          dataIndex: 'argument_insert_action',
          align: 'center',
          width: 265,
          fixed: 'right',
          scopedSlots: { customRender: 'argument_insert_action' }
        }
      ],

      
      headers: {
        authorization: 'authorization-text'
      },
      // arr: {'fieldname': '', 'fieldvalue': ''},//方案参数的表头
      // flag:false,//编辑弹层显示与隐藏
      // editDetail:{},//編輯內容
      //  arrs: [
      //           {'fieldname': '高度', 'fieldvalue': '5',id:1}
      //           ],
      createPassShow: true,
      adoptShow: false,
      extracts: false, // 抽取完成model的显示消失
      extracts_end: false, // 抽取完成里对话框model的显示消失
      randomextract_switch: false, // 专家抽取按钮的对话框
      datestring: '',
      dateFormat: 'YYYY/MM/DD',
      projectname: '',
      isRoleId: '',
      isProjectName: '',
      extractvisible: false, // 专家抽取
      QRcodevisible: false, // 二维码
      programmevisible: false,//方案参数
      pdfarray: {},
      filepdf: true,
      open: false,
      handspun_state: false, // 手工抽取按钮显示
      review: false, // 专家抽取和最终完成、审核、流号、删除的按钮显示
      experts_merger: false, // 最终完成按钮判断是否还有未审核专家
      // review_twe: false,
      review_one: false, // 抽取完成的按钮显示
      owner_switch: false, // 最终完成的按钮显示
      transit: false,
      uploading: false,
      defaultSelectKey: [2], // 默认选中项
      disvisible: true,
      search: '',
      searchmanual: '',
      extract_status: '',
      expertvisible: false,
      expertmessage: {
        my_photo: [],
        my_card_photo: [],
        academic_credentials: [],
        title_document: [],
        practice_qualification_certificate: []
      }, // 列表专家信息
      avoidancevalue: {}, // 回避条件
      confirmLoading: false,
      confirmLoadingreport: false,
      extractLoading: false,
      extractStatus: '',
      optionjugde: 'notverify', // 判断是否是待审核列表
      collapsed: false,
      treekey: '', // 危大工程类别id
      refusebutton: Boolean,
      savestatus: Boolean,
      visible: false,
      reportvisible: false, // 论证报告模态框
      projectTypeId: 1,
      loading: false,
      openKeys: [1], // 默认打开树状列表的key值
      treespan: 3,
      tablespan: 21,
      projectnumber: {},
      fileList:[],
      dataSource: [],
      parameterref:{},//方案参数
      argumentmessage: {
      },
      argumentreport: {},
      extractionrules: {},
      isAvoidOpen: '',
      isExtractOpen: '',
      aproject_name:'',//二维码中获取的论证名称
      aclassic_name:'',//论证类型
      abulid_unit:'',//承建单位
      rules: {
        argument_num: [
          { required: true, message: '内容不可为空', trigger: 'blur' }
        ],
        // people_name: [
        //   { required: true, message: '内容不可为空', trigger: 'blur' }
        // ],
        phone: [
          // { trigger: 'blur' },ffewecedvcefvce
          { type: 'number', message: '内容必须是数字' }
        ],
        project_name: [
          { required: true, message: '内容不可为空', trigger: 'blur' }
        ],
        category_id: [
          { required: false, message: '内容不可为空', trigger: 'blur' }
        ],
        isProject_name: [
          { required: false, message: '内容不可为空' }
        ],
        construction_unit: [
          { required: true, message: '内容不可为空', trigger: 'blur' }
        ],
        supervision_unit: [
          { required: true, message: '内容不可为空', trigger: 'blur' }
        ],
        bulid_unit: [
          { required: true, message: '内容不可为空', trigger: 'blur' }
        ],
        // project_site: [
        //   { required: true, message: '内容不可为空', trigger: 'blur' }
        // ],
        entrust_time: [
          { required: true, message: '内容不可为空' }
        ]
      },
      // 表头
      columns: [
        {
          title: '序号',
          dataIndex: 'index',
          key: 'index',
          align: 'center',
          width: 70,
          customRender: (text, record, index) => `${(this.pagination.current - 1) * this.pagination.pageSize + index + 1}`
        },
        {
          title: '论证编号',
          dataIndex: 'argument_num'
          // sorter: true,
          // needTotal: true,
          // customRender: (text) => text + ' 次'
        },
        {
          title: '论证名称',
          dataIndex: 'project_name',
          width: 250
        },
        {
          title: '联系方式',
          dataIndex: 'phone'
        },
        {
          title: '委托日期',
          dataIndex: 'entrust_time'
        },
        {
          title: '论证日期',
          dataIndex: 'create_time'
        },
        {
          // title: this.titlename,
          dataIndex: 'status',
          scopedSlots: { customRender: 'status', title: 'titlename' },
          width: 110
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          width: 265,
          fixed: 'right',
          scopedSlots: { customRender: 'action' }
        }
      ],
      selectedRowKeys: [], // Check here to configure the default column
      titlename: '论证状态',
      dialogTitle: undefined,
      rowSelection: [],
      passwordVisible: false,
      // extractstatus: '1',
      createVisible: false,
      code: '',
      pass: {},
      orgTree: [],
      ApprovedList_optional: [], // 已审核专家的正选
      ApprovedList_real: [], // 已审核专家的备选
      getstutas: '',
      getstutasPdf: '',
      experttype: '', // 专家类别
      categorykind:'',//工程类别
      exunit: [],
      pagination: {
        current: 1,
        pageSize: 10,
        total: 0,
        showSizeChanger: true,
        pageSizeOptions: ['10', '20', '30', '50']
      },
      // 正选列表
      positiveloading: false,
      positivecolumns: [
        {
          title: '序号',
          dataIndex: 'index',
          key: 'index',
          align: 'center',
          width: 70,
          customRender: (text, record, index) => `${index + 1}`
        },
        {
          title: '姓名',
          dataIndex: 'username'
        },
        {
          title: '小组职务',
          dataIndex: 'job'
        },
        {
          title: '专家级别',
          dataIndex: 'experts_level'
        },
        {
          title: '专家职称',
          dataIndex: 'experts_title'
        },
        {
          title: '单位名称',
          dataIndex: 'company_name'
        },
        {
          title: '审核情况',
          dataIndex: 'audit_status',
          align: 'center',
          scopedSlots: { customRender: 'audit_status' }
        },
        {
          title: '操作',
          dataIndex: 'positiveaction',
          align: 'center',
          // width: 209,
          // fixed: 'right',
          scopedSlots: { customRender: 'positiveaction' }
        }
      ],
      exportlist: [
        {
          title: '序号',
          dataIndex: 'index',
          key: 'index',
          align: 'center',
          width: 70,
          customRender: (text, record, index) => `${index + 1}`
        },
        {
          title: '姓名',
          dataIndex: 'username'
        },
        {
          title: '小组职务',
          dataIndex: 'job'
        },
        {
          title: '专家级别',
          dataIndex: 'experts_level'
        },
        {
          title: '专家职称',
          dataIndex: 'experts_title'
        },
        {
          title: '单位名称',
          dataIndex: 'company_name'
        },
        {
          title: '审核情况',
          dataIndex: 'audit_status',
          align: 'center',
          scopedSlots: { customRender: 'audit_status' }
        }
      ],
      selectedpositiveKeys: [],
      positiveSelection: [],
      positivedataSource: [],
      positivepagination: false,
      // 备选列表
      alternativeloading: false,
      alternativecolumns: [
        {
          title: '序号',
          dataIndex: 'index',
          key: 'index',
          align: 'center',
          width: 70,
          customRender: (text, record, index) => `${index + 1}`
        },
        {
          title: '姓名',
          dataIndex: 'username'
        },
        {
          title: '小组职务',
          dataIndex: 'job'
        },
        {
          title: '专家级别',
          dataIndex: 'experts_level'
        },
        {
          title: '专家职称',
          dataIndex: 'experts_title'
        },
        {
          title: '单位名称',
          dataIndex: 'company_name'
        },
        {
          title: '审核情况',
          dataIndex: 'audit_status',
          align: 'center',
          scopedSlots: { customRender: 'audit_status' }
        },
        {
          title: '操作',
          dataIndex: 'alternativeaction',
          align: 'center',
          // width: 209,
          // fixed: 'right',
          scopedSlots: { customRender: 'alternativeaction' }
        }
      ],
      selectedalternativeKeys: [],
      alternativeSelection: [],
      alternativedataSource: [],
      alternativepagination: false,
      // 手工抽取列表
      manualvisible: false,
      manualloading: false,
      manualcolumns: [
        {
          title: '序号',
          dataIndex: 'index',
          key: 'index',
          align: 'center',
          width: 70,
          customRender: (text, record, index) => `${index + 1}`
        },
        {
          title: '姓名',
          dataIndex: 'username'
        },
        {
          title: '手机',
          dataIndex: 'phone'
        },
        {
          title: '专家级别',
          dataIndex: 'experts_level'
        },
        {
          title: '专家职称',
          dataIndex: 'experts_title'
        },
        {
          title: '单位名称',
          dataIndex: 'company_name'
        },
        {
          title: '轮空值',
          dataIndex: 'skip_num'
        },
        {
          title: '操作',
          dataIndex: 'manualaction',
          align: 'center',
          // width: 209,
          // fixed: 'right',
          scopedSlots: { customRender: 'manualaction' }
        }
      ],
      selectedmanualKeys: [],
      manualSelection: [],
      manualdataSource: [],
      manualpagination: {
        current: 1,
        pageSize: 10,
        total: 0,
        showSizeChanger: true,
        pageSizeOptions: ['10', '20', '30', '50']
      },
      // 专家详情table
      expertdataSource: [],
      expertcolumns: [
        {
          title: '工程名称',
          dataIndex: 'project_name'
        },
        {
          title: '职务',
          dataIndex: 'expert_job'
        },
        {
          title: '抽取类型',
          dataIndex: 'extract_type'
        }
      ],
      previewVisible: false,
      previewImage: '',
      form: this.$form.createForm(this)
    }
  },
  computed: {
    ...mapState({
      roleId: state => state.user.info.roleId,
      aProjectName: state => state.user.info.username
    }),
    hasSelected () {
      return this.selectedRowKeys.length > 0
    },
    posthasSelected () {
      return this.selectedpositiveKeys.length > 0
    },
    alterhasSelected () {
      return this.selectedalternativeKeys.length > 0
    },
    manualSelected () {
      return this.selectedmanualKeys.length > 0
    },
  },
  watch: {
    search: function (newVal, oldVal) {
      delay(() => {
        this.onSearch(newVal)
      }, 1000)
    },
    searchmanual: function (newVal, oldVal) {
      delay(() => {
        this.onSearchmanual(newVal)
      }, 1000)
    }
    // reportvisible: 'change '
  },
  created () {
    this.getMenuInfo()
  },
  mounted () {
  },
  methods: {
    //方案参数编辑按钮
    editRowIndex(key) {
      // console.log(key)
      const newData = [...this.dataSource1]
      const target = newData[key]
      console.log(target)
      if (target) {
        target.isinput = true
        this.dataSource1 = newData
      }
    },
    //保存按钮
    saveRowIndex(key) {
      const newData = [...this.dataSource1]
      const target = newData[key]
      if (target) {
        target.isinput = false
        // target.isAdd = false
        this.dataSource1 = newData
        console.log(newData)
      }
    },
    //方案参数取消按钮
    cancelIndex(key){
      const newData = [...this.dataSource1]
      const target = newData[key]
      if (target) {
        target.isinput = false
        // if (target.isAdd) {
        //   newData.splice(key, 1)
        // }
        this.dataSource1 = newData
      }
    },
    //方案参数删除按钮
    delRowIndex(key) {
      const newData = [...this.dataSource1]
      const target = newData[key]
      if (target) {
        newData.splice(key, 1)
      }
      this.dataSource1 = newData
    },
        //表格确定回调
    handleChangeIndex(value, key, column) {
      const dataSource2 = [...this.dataSource1]
      const target = dataSource2[key]
      if (target) {
        target[column] = value
        this.dataSource1 = dataSource2
      }
    },
    //新增行
    isAdd() {
      const newData = {
        isinput: true,
        argument_insert_name: '',//字段名
        argument_insert_value: ''
      }
        this.dataSource1.push(newData)
      console.log(newData.argument_insert_name)
    },
    
    // handleChange (info) {
    //   if (info.file.status === 'uploading') {
    //     this.loading = true
    //     return
    //   }
    //   if (info.file.status === 'done') {
    //     // Get this url from response in real world.
    //     getBase64(info.file.originFileObj, imageUrl => {
    //       this.imageUrl = imageUrl
    //       this.loading = false
    //     })
    //   }
    // },

    changeDefaultExtract (index, value) {
      this.extractionrules.extract_rules[index].rule_value = value
      console.log(index, value)
    },
    changeDefaultAvoid (index, value) {
      this.extractionrules.avoid_rules[index].type_name = value
    },
    //工程类别
    changecategory (value) {
        console.log(value)
        categorytype().then(res => {
        this.categorykind = res.result.category_type
        this.cateid = res.result.category_type[value].category_id
        this.cateone = this.categorykind[0].category_name
        console.log(this.cateid)
      })
    },
    showConfirm () {
      console.log('不足')
      // eslint-disable-next-line no-unused-vars
      var that = this
      this.$confirm({
        title: '当前可抽取人数不足',
        okText: '取消轮空值',
        cancelText: '不取消轮空值',
        content: h => <div style="color:red;">是否需要取消轮空值？</div>,
        onOk () {
          console.log('OK')
          that.passwordVisible = true
          // that.extract_status = 0 // 非正常抽取
          Object.assign(that.extractionrules, { 'extract_status': 0 })
        },
        onCancel () {
          console.log('Cancel')
          that.passwordVisible = true
          // that.extract_status = 1 // 正常抽取
          Object.assign(that.extractionrules, { 'extract_status': 1 })
        },
        class: 'test'
      })
    },
    moment,
    onChangeday (date, dateString) {
      this.datestring = dateString
      this.onSearch()
    },
    async handlePreview (file) {
      if (!file.url && !file.preview) {
        file.preview = await getBase64(file.originFileObj)
      }
      this.previewImage = file.url || file.preview
      this.previewVisible = true
    },
    handleCancelimg () {
      this.previewVisible = false
      this.previewImage = ''
    },
    deletemess () {
      this.loading = true
      this.selectedRowKeys.map(String)
      var deletefd = new FormData()
      deletefd.append('argument_ids', this.selectedRowKeys)
      agrumentdelete(deletefd).then(res => {
        if (res.message === 'success') {
          this.$message.success('删除成功')
        } else {
          alert(res.message)
        }
      })
      setTimeout(() => {
        this.getTableData()
        this.loading = false
        this.selectedRowKeys = []
        this.rowSelection = []
      }, 1000)
    },
    back () {
      // this.reload()
      this.getTableData()
      this.disvisible = true
      this.positivedataSource = []
      this.alternativedataSource = []
    },
    rowClassName () {
      return 'rowClass'
    },
    audit (value) {
      this.buttonFront = 0
      var auditnums = []
      auditnums = [...this.selectedpositiveKeys, ...this.selectedalternativeKeys]
      var auditmess = {}
      if (value === 1) {
        auditmess = {
          'argument_id': this.extractionrules.argument_id,
          'argument_experts_id': auditnums,
          'operation': 'audit'
        }
      } else if (value === 2) {
        auditmess = {
          'argument_id': this.extractionrules.argument_id,
          'argument_experts_id': auditnums,
          'operation': 'flow'
        }
      } else {
        auditmess = {
          'argument_id': this.extractionrules.argument_id,
          'argument_experts_id': auditnums,
          'operation': 'delete'
        }
      }
      operateextract(auditmess).then(res => {
        if (res.code === 200) {
          this.$message.success(res.result)
          var id = new FormData()
          id.append('argument_id', this.extractionrules.argument_id)
          getauditmess(id).then(resu => {
            if (resu.code === 200) {
              this.positivedataSource = resu.result.real
              this.alternativedataSource = resu.result.optional
              this.positiveloading = true
              this.alternativeloading = true
              var expertsAll = this.positivedataSource.concat(this.alternativedataSource)
              expertsAll.forEach(expertsAll => { // 遍历数组对象有未审核则返回0
              if (expertsAll.audit_status.indexOf('未审核') > -1) {
                  this.buttonFront = -1
                }
              })
              if (this.buttonFront === -1) {
                console.log('还有未审核不变灰')
                this.experts_merger = true
              } else {
                console.log('没有未审核变灰')
                this.experts_merger = false
              }
            }
            setTimeout(() => {
              this.positiveloading = false
              this.alternativeloading = false
              this.selectedpositiveKeys = []
              this.positiveSelection = []
              this.selectedalternativeKeys = []
              this.alternativeSelection = []
            }, 900)
            var experts = new FormData()
            experts.append('argument_id', this.project_expert)
            auditedexpert(experts).then(res => { // 输出已审核名单控制抽取完成按钮的开关
              this.audit_expert = res.result.optional.length + res.result.real.length
              console.log(this.audit_expert)
              if (this.audit_expert >= 5) {
                this.review_one = false
              }
            })
          })
        } else {
          this.$message.error(res.message)
        }
      })
    },
    onChangeBoxAvoid (e) {
      this.extractionrules.avoid_rules.some((item) => {
        if (item.rule_id === e.target.value) {
          item.checked = e.target.checked
          return true
        }
      })
    },
    onChangeBoxOne (e) {
      this.extractionrules.avoid_rules.some((item) => {
        if (item.rule_id === e.target.value) {
          item.rule_value = e.target.checked
          item.checked = e.target.checked
          return true
        }
      })
    },
    onChangeBoxTwo (e) {
      this.extractionrules.extract_rules.some((item) => {
        if (item.rule_id === e.target.value) {
          item.checked = e.target.checked
          return true
        }
      })
    },
    handlereportexp (record) { // 专家抽取点进来的事件
      console.log(record)
      this.buttonFront = 0
      this.project_expert = record.argument_id
      this.projectname = record.project_name
      this.projectnumber = record.argument_num
      this.project_statu = record.expert_status
      console.log(this.project_statu)
      this.disvisible = false
      var argumentmessid = new FormData()
      argumentmessid.append('argument_id', record.argument_id)
      getxtractionrules(argumentmessid).then(res => {
        Object.assign(res.result, { 'argument_id': Number(record.argument_id) })
        this.extractionrules = res.result
      // if (res.result.other_rules[0].rule_value > 3){
      //   this.review = true
      // }
      console.log(res.result.other_rules[0].rule_value)
        // var a=5
        // var a = res.result.other_rules[0].rule_value
        // var chou = res.result.other_rules[0].rule_value
        // console.log(chou)
        if (this.roleId === 'admin') {
          this.isRoleId = this.roleId
          console.log(this.isRoleId)
        }
        if (this.roleId === 'itemRegistration') {
          this.isRoleId = this.roleId
          console.log(this.isRoleId)
        }
      })
      getauditmess(argumentmessid).then(res => {
        if (res.code === 200) {
          this.positivedataSource = res.result.real
          this.alternativedataSource = res.result.optional
          this.expert_number = this.positivedataSource.length + this.alternativedataSource.length
          this.positiveloading = true
          this.alternativeloading = true
          var expertsAll = this.positivedataSource.concat(this.alternativedataSource)
          // console.log(expertsAll)
          expertsAll.forEach(expertsAll => { // 遍历数组对象有未审核则返回0
          if (expertsAll.audit_status.indexOf('未审核') > -1) {
              this.buttonFront = -1
            }
          })
          if (this.buttonFront === -1) {
            console.log('还有未审核变灰')
            this.experts_merger = true
          } else {
            console.log('没有未审核不变灰')
            this.experts_merger = false
          }
        }
        setTimeout(() => {
          this.positiveloading = false
          this.alternativeloading = false
        }, 500)
      })
      var experted = new FormData()
      experted.append('argument_id', this.project_expert)
      auditedexpert(experted).then(res => { // 输出已审核名单控制抽取完成按钮的开关
        this.audit_experts = res.result.optional.length + res.result.real.length
        if (this.project_statu === 'first') {
            this.review = false
            if (this.audit_experts >= 5) {
              this.review_one = false
            } else if (this.audit_experts < 5) {
              this.review_one = true
            }
            if (this.expert_number > 0) {
              this.handspun_state = false
            } else {
              this.handspun_state = true
            }
            console.log('1')
        } else if (this.project_statu === 'second' && this.isRoleId === 'itemRegistration') {
            this.review = true
            this.review_one = true
            this.handspun_state = true
            console.log('2')
        } else if (this.project_statu === 'second' && this.isRoleId === 'admin') {
            this.review = false
            this.review_one = false
            if (this.expert_number > 0) {
              this.handspun_state = false
            } else {
              this.handspun_state = true
            }
            console.log('3')
        } else if (this.project_statu === 'third' && this.isRoleId === 'admin') {
            this.review = true
            this.review_one = true
            this.handspun_state = true
            console.log('4')
        } else if (this.project_statu === 'third' && this.isRoleId === 'itemRegistration') {
            this.review = true
            this.review_one = true
            this.handspun_state = true
            console.log('5')
        }
      })
      localStorage.setItem('argument_id', record.argument_id) // 设置键的值
    },
    onSearch (value) {
      var searchmes = new FormData()
      searchmes.append('query', this.search)
      searchmes.append('per_page', this.pagination.pageSize)
      searchmes.append('current_page', this.pagination.current)
      searchmes.append('key_value', this.projectTypeId)
      if (this.datestring[0]) {
        searchmes.append('start_date', (new Date(this.datestring[0])).getTime() / 1000)
        searchmes.append('end_date', (new Date(this.datestring[1])).getTime() / 1000)
      }
      this.loading = true
      agrusearch(searchmes).then(res => {
        this.dataSource = res.result.data
        Object.assign(this.pagination, { 'pageSize': Number(res.result.per_page), 'total': res.result.total, 'current': res.result.current_page })
        this.loading = false
      })
    },
    onSearchmanual () {
      var searchmanualmess = new FormData()
      searchmanualmess.append('query', this.searchmanual)
      searchmanualmess.append('per_page', this.manualpagination.pageSize)
      searchmanualmess.append('current_page', this.manualpagination.current)
      manualsearch(searchmanualmess).then(res => {
        this.manualdataSource = res.result.data
        Object.assign(this.manualpagination, { 'pageSize': Number(res.result.per_page), 'total': res.result.total, 'current': res.result.current_page })
      })
    },
    // 论证报告上传
    handlereportData (record) {
      this.reportvisible = true
      console.log(record)
      this.argumentreport = JSON.parse(JSON.stringify(record))
      console.log(this.argumentreport)
      var getmess = new FormData()
      console.log(record.argument_id)
      getmess.append('argument_id', record.argument_id)
      getreport(getmess).then(res => {
        console.log(res)
        this.getstutas = res
        // this.getstutasPdf = res.result.file
        console.log(res)
        // Object.assign(record, { 'argument_report_id': Number(res.result.argument_report_id), 'report_desc': res.result.report_desc })
        this.argumentreport = JSON.parse(JSON.stringify(record))
        console.log(this.argumentreport)
        if (this.argumentreport.status == '未进行论证') {//eslint-disable-line
          this.argumentreport.status = '通过'
          this.argumentreport.create_time = res.result.argument_time
        }
        // if (this.argumentreport.report_pdf) { 
        //   this.filepdf = false
        // }
        if(res.result.name.length>0){
          var i = 0
        const arr1 = []
        for (i; i < res.result.name.length; i++) {
        const obj = {
          uid: i,
          name: res.result.name[i],
          status: 'done',
          url: res.result.url[i]
        }
        // debugger // 结点
        // console.log('obj: ', obj)
        arr1.push(obj)
       }
        const arr2 = arr1.splice(0, 1)// 这里用到了splice的删除，返回的是被删除的数组
        const arr3 = arr1.splice(0, 1)// 这里配合a-upload组件的限制上传数量只能上传三个
        const arr4 = arr1.splice(0, 1)// change里面的handleUploadChange方法可以看一下文档
        // console.log(arr2, arr3, arr4)
        this.fileList = [...arr2, ...arr3, ...arr4]
        }
        
      })
    },
    //方案参数
    parameters (record) {
      console.log(record.argument_id)
      var parametermess = new FormData()
      parametermess.append('argument_id', record.argument_id)
      getparameter(parametermess).then(res => {
        console.log(this.dataSource1)
        if(res.result[1] instanceof Array === true) {
        const arry = res.result[1]
        for(let i = 0; i < arry.length; i++){
          arry[i].isinput = false
        }
        this.dataSource1 = arry
        console.log(this.dataSource1)
      } else{
        this.dataSource1 = [ res.result[1] ]
      }
        }
      )
      this.programmevisible = true
    },
    transmit (record) {
      this.QRcodevisible = true
      this.aproject_name = record.project_name
      this.aclassic_name = record.classic_name
      this.abulid_unit = record.bulid_unit
      console.log(record)
      this.$nextTick(function () {
        this.$refs.qrcode.innerHTML = ''
        this.qrcode(record.argument_id)
      })
    },
    qrcode (arid) { // https://blog.csdn.net/qq_42866164/article/details/104960777根据这个教程写的
      const text = `https://www.zsjx.fit/User?argumentid=${arid}` // 生成二维码的链接
      var qrcode = new QRCode('qrcode', {
        width: 180, // 二维码宽度，单位像素
        height: 180, // 二维码高度，单位像素
        text: text, // 生成二维码的链接
        render: 'canvas'
      })
      // qrcode.toDataURL(text, (url) => {
      //     this.$refs.qrcode.src = url
      //   })

      console.log(qrcode)
      console.log(arid)
    },
    qrcodemodel () {
      this.QRcodevisible = false
    },
    //方案参数确认按钮
    programmeModelOk () {
      // console.log(record)
      console.log(this.dataSource1)
      this.programmevisible = false
      if(this.dataSource1.length != 0){
      var programmemess = {'argument_parameter':[
          {'argument_id':this.dataSource1[0].argument_id,
          'parameter':this.dataSource1
          }
        ]
      }
      }
      else {
        var programmemess = {'argument_parameter':[
          {'argument_id':this.dataSource1.argument_id,
          'parameter':this.dataSource1
          }
        ]
      }
      }
      addparameter(programmemess).then(res => {
        // this.dataSource1 = JSON.parse(JSON.stringify(res.result[1]))
        console.log(res)
        if (res.code === 200) {
          this.$message.success('编辑方案参数成功！')
          this.programmeModeClose()
        } else {
          this.$message.error({
            message: res.code,
            description: res.message
          })
        }
      })
      console.log(programmemess)
    },
    //方案参数取消按钮
    programmeModeClose () {
      this.programmevisible = false
    },

    // 论证报告里的文件上传
    handleUpload (data) {
      const file = {
        uid: '-1',
        // thumbUrl: res.result[0].url,
        name: data.file.name,
        status: 'uploading',
        url: ''
      }
      console.log(data.file)
      this.fileList.push(file)
      var fd = new FormData()
      fd.append('file[]', data.file)
      // console.log(fd)
      // console.log(data.file)
      sendpdf(fd).then(res => {
        if (res.code === 200) {
          this.$notification.success({
            message: '上传成功'
          })
          file.uid = res.result[0].file_id
          // file.name = res.result[0].file_id
          file.status = 'done'
          file.url = res.result[0].url
          file.file_id = res.result[0].file_id
          console.log(this.fileList)
        } else {
          this.$notification.error({
            message: res.code,
            description: res.message
          })
        }
      }).catch(err => {
        this.$notification.error({
          message: err.code,
          description: err.message
        })
        console.log(err)
      })
    },
    handlereportOk () {
      this.transit = true
      console.log(this.fileList)
      console.log(JSON.stringify(this.argumentreport))
      var reportmess = {
        'report_desc': this.argumentreport.report_desc,
        'argument_id': this.argumentreport.argument_id,
        'argument_status': this.argumentreport.status,
        'file': this.fileList
      }
      console.log(reportmess)
      var reportmessage = []
      reportmessage.push(reportmess)
      console.log(reportmessage)
      var a = {
        'argument_report': reportmessage,
        'argument_time': (new Date(this.argumentreport.create_time)).getTime() / 1000
      }
      console.log((new Date(this.argumentreport.create_time)).getTime() / 1000)
      addreport(a).then(res => {
        console.log(res)
        this.create = res.result
        if (res.code === 200) {
          this.$message.success('保存成功')
          this.handlereportClose()
        } else {
          this.$message.error({
            message: res.code,
            description: res.message
          })
        }
      })
      var reportstatus = new FormData()
      reportstatus.append('argument_id', this.argumentreport.argument_id)
      reportstatus.append('status', this.argumentreport.status)
      modstatus(reportstatus)
      this.confirmLoadingreport = true
      setTimeout(() => {
        this.getTableData()
        this.confirmLoadingreport = false
      }, 1000)
    },
    handleRemove (file) {
      const index = this.fileList.indexOf(file)
      console.log(index)
      const newFileList = this.fileList.slice()
      newFileList.splice(index, 1)
      this.fileList = newFileList
    },
    beforeUploadPdf (file) {
      console.log(file)
      this.fileList = []
      return true
    },
    handleUploadChange (info) {
      this.fileList = this.fileList.slice(-3)
    },

    handlereportClose () {
      this.reportvisible = false
      this.argumentreport = {}
      this.fileList = []
      this.filepdf = true
    },
    addargument (record) {
      this.isRoleId = this.roleId
      console.log(this.isRoleId)
      this.isProjectName = this.aProjectName
      console.log(this.aProjectName)
      this.savestatus = false
      this.dialogTitle = '添加论证'
      this.visible = true
      getentrusttime().then(res => {
        Object.assign(record, { 'entrust_time': res.result[0] })
        this.argumentmessage = JSON.parse(JSON.stringify(record))
        console.log(this.argumentmessage)
      })
      // 工程类别定义接口
      categorytype().then(res => {
        this.categorykind = res.result.category_type
        this.value = res.result.category_type[0].category_id
        Object.assign(record, { 'category_id': this.value })
        // this.argumentreport = JSON.parse(JSON.stringify(record))
        console.log(this.value,this.visible  )
        
        // console.log(this.cateid)
        // console.log(res.result)
      })
       Object.assign(record, { 'category_id': this.value||0 })
    },
    handleClick (e) {
      this.treekey = parseInt(e.key)
      console.log(this.treekey)
      this.projectTypeId = e.key
      console.log(e.key)
      this.defaultSelectKey[0] = e.key
      this.optionjugde = e.key.split('-')[1]
      this.openKeys[0] = parseInt(e.key.split('-')[0])
      console.log(this.openKeys[0])
      if (this.optionjugde === 'notverify') {
        this.titlename = '论证状态'
      } else {
        this.titlename = '论证结论'
      }
      this.getTableData()
    },
    handleTitleClick (item) {
      // console.log('handleTitleClick', item)
    },
    titleClick (e) {
      // console.log('titleClick', e)
    },
    getMenuInfo () {
      // this.loading = true
      menuFinds().then(res => {
        // console.log(res.result[0].children[0].key)
        this.treekey = res.result[0].children[0].key
        this.orgTree = res.result
        console.log(this.treekey)
        // this.loading = false
        this.openKeys[0] = this.orgTree[0].argument_classic_id
        console.log(this.openKeys[0])
        this.defaultSelectKey[0] = this.orgTree[0].children[0].key
        this.projectTypeId = this.orgTree[0].children[0].key
        this.getTableData()
      })
    },
    onSelectChange (selectedRowKeys, rowSelection) {
      this.selectedRowKeys = selectedRowKeys
      this.rowSelection = rowSelection
    },
    onpositiveChange (selectedRowKeys, rowSelection) {
      this.selectedpositiveKeys = selectedRowKeys
      this.positiveSelection = rowSelection
      console.log(selectedRowKeys)
    },
    onalternativeChange (selectedRowKeys, rowSelection) {
      this.selectedalternativeKeys = selectedRowKeys
      this.alternativeSelection = rowSelection
    },
    onmanualChange (selectedRowKeys, rowSelection) {
      this.selectedmanualKeys = selectedRowKeys
      this.manualSelection = rowSelection
    },
    handleTableChange (pagination) {
      this.pagination.current = pagination.current
      this.pagination.pageSize = pagination.pageSize
      if (this.search) {
        this.onSearch()
      } else {
        this.getTableData()
      }
    },
    handleTableChangemanual (pagination) {
      this.manualpagination.current = pagination.current
      this.manualpagination.pageSize = pagination.pageSize
      console.log(this.manualpagination.current, this.manualpagination.pageSize)
      if (this.searchmanual) {
        // console.log('搜索')
        // this.onSearchmanual()
      } else {
        // console.log('没有搜索')
        this.manualextract()
      }
    },
    randomextract_yes () {
      this.randomextract_switch = false
      console.log(this.roleId)
      this.open = true
      console.log('账号类型roleId：' + this.roleId)
      this.isRoleId = this.roleId
      console.log('账号类型isRoleId：' + this.isRoleId)
      // eslint-disable-next-line camelcase
      var new_argument_id = localStorage.getItem('argument_id') // 获取键的值
      var type = new FormData()
      type.append('type_kinds', '1')
      type.append('argument_id', new_argument_id)
      getexperttype(type).then(res => {
        this.experttype = res.result._expert_type
        console.log(this.experttype)
        this.extractvisible = true
      })
      extractunit(type).then(res => {
        if (res.code === 200) {
          this.exunit = res.result[1]
          console.log(this.exunit)
        }
      })
      this.extractvisible = true
      // 抽取次数
      // this.review = true
    },
    owner_yes () {
        this.owner_switch = false
        var completed = new FormData()
        completed.append('argument_id', this.project_expert)
        completed.append('expert_status', 'third')
        changexpert(completed).then(res => {
        console.log(res)
        this.review = true
        this.review_one = true
        this.handspun_state = true
      })
    },
    randomextract () {
        // var argumentmessid = new FormData()
        // argumentmessid.append('argument_id', record.argument_id)
        // getxtractionrules(argumentmessid).then(res => {
        // Object.assign(res.result, { 'argument_id': Number(record.argument_id) })
        // this.extractionrules = res.result
        // if(res.result.other_rules[0].rule_value > 1) {
        //   this.review = true
        // }
        // })
        // getxtractionrules(this.extractionrules).then(res => {
        // this.extractionrules = res.result
        // if(res.result.other_rules[0].rule_value > 1) {
        //   this.review = true
        // }
        // else {
        //   this.randomextract_switch = true
        // }
        // })
          this.randomextract_switch = true
    },
    manualextract () {
      this.manualvisible = true
      var handmess = new FormData()
      handmess.append('per_page', this.manualpagination.pageSize)
      handmess.append('current_page', this.manualpagination.current)
      handmess.append('argument_id', this.extractionrules.argument_id)
      gethandmess(handmess).then(res => {
        console.log(res.result)
        this.manualdataSource = res.result.data
        if (this.manualdataSource) {
        // eslint-disable-next-line
        Object.assign(this.manualpagination, { 'pageSize': Number(res.result.per_page), 'total': res.result.total, 'current': res.result.current_page })
        }
        // this.$options.methods.onSearchmanual.bind(this)()
        // console.log(this.manualdataSource)
      })
    },
    extraction () { // 抽取完成获取已审核专家接口
      this.extracts = true
      var expert = new FormData()
      expert.append('argument_id', this.project_expert)
      auditedexpert(expert).then(res => {
        console.log(res)
        this.ApprovedList_optional = res.result.optional
        this.ApprovedList_real = res.result.real
      })
    },
    complete () { // 抽取完成的确定按钮
      this.extracts_end = true
    },
    complete_end () { // 抽取完成里对话框的确定按钮
      this.extracts = false
      this.extracts_end = false
      var completes = new FormData()
      completes.append('argument_id', this.project_expert)
      completes.append('expert_status', 'second')
      changexpert(completes).then(res => {
        console.log(res.result)
        this.review = true
        this.review_one = true
        this.handspun_state = true
      })
    },
    owner () { // 最终完成按钮
        this.owner_switch = true
    },
    manualadd () { // 手工抽取的添加
      var addmess = {
        'argument_id': this.extractionrules.argument_id,
        'argument_experts_id': this.selectedmanualKeys,
        'operation': 'add_hand'
      }
      operateextract(addmess).then(res => {
        if (res.code === 200) {
          this.$message.success('手动抽取成功')
          var manualid = new FormData()
          manualid.append('argument_id', this.extractionrules.argument_id)
          getauditmess(manualid).then(resu => {
            if (resu.code === 200) {
              this.positivedataSource = resu.result.real
              this.alternativedataSource = resu.result.optional
              this.positiveloading = true
              this.alternativeloading = true
            }
            setTimeout(() => {
              this.positiveloading = false
              this.alternativeloading = false
              this.selectedmanualKeys = []
              this.manualSelection = []
            }, 500)
          })
        } else {
          this.$message.error(res.message)
        }
      })
      this.manualCancel()
    },
    manualCancel () {
      this.manualvisible = false
      this.selectedmanualKeys = []
      this.manualSelection = []
    },
    handleExtractOk () {
      this.$refs['extractionrules'].validate(valid => {
        if (!valid) {
          return false
        } else {
          preExtract(this.extractionrules).then(res => {
            this.extractStatus = res.result[0]
            this.extractLoading = true
            if (this.extractStatus === '抽取人数足够') {
              this.passwordVisible = true
              Object.assign(this.extractionrules, { 'extract_status': 1 })
            } else {
              console.log('人数不足')
              this.showConfirm()
            }
          })
          setTimeout(() => {
            this.extractLoading = false
          }, 500)
        }
      })
    },
    handleExtractClose () {
      this.extractvisible = false
    },
    passwordOk () {
      this.$refs.pass.validate(valid => {
        if (!valid) {
          return false
        } else {
          var verify = new FormData()
          console.log(verify)
          verify.append('item_type', 'argument')
          verify.append('item_id', this.extractionrules.argument_id)
          verify.append('extract_password', this.pass.inputPassword)
          console.log(this.extractionrules)
          usePassword(verify).then(res => {
            if (res.code === 200) {
              extract(this.extractionrules).then(res => {
                if (res.code === 200) {
                  if (res.result[0] === 1) {
                    this.$message.success('当前专家库中无可抽取专家，请添加专家或进行手工抽取')
                  } else {
                    this.$message.success('抽取成功')
                    this.positivedataSource = res.result.real
                    this.alternativedataSource = res.result.optional
                    this.positiveloading = true
                    this.alternativeloading = true
                    this.handspun_state = false
                    // 专家抽取
                    // var argumentmessid = new FormData()
                    // argumentmessid.append('argument_id', record.argument_id)
                    // getxtractionrules(argumentmessid).then(res => {
                    //   Object.assign(res.result, { 'argument_id': Number(record.argument_id) })
                    //   this.extractionrules = res.result
                    //   if(res.result.other_rules[0].rule_value > 1) {
                    //     this.review = true
                    //   }
                    // })
                  }
                } else {
                  this.$message.error(res.message)
                }

                setTimeout(() => {
                  this.positiveloading = false
                  this.alternativeloading = false
                  this.extractLoading = false
                  this.handleExtractClose()
                  this.passwordCancel()
                }, 500)
              })
              this.passwordVisible = false
            } else {
              this.$message.error('密码错误')
            }
              // var argumentmessid = new FormData()
              //       argumentmessid.append('argument_id', record.argument_id)
              //       getxtractionrules(argumentmessid).then(res => {
              //         Object.assign(res.result, { 'argument_id': Number(record.argument_id) })
              //         this.extractionrules = res.result
              //         if(res.result.other_rules[0].rule_value > 1) {
              //           this.passwordVisible = false
              //           this.review = true
              //         }
              //       })
              // this.review = true
          })
        }
      })
    },
    passwordCancel () {
      this.passwordVisible = false
      this.pass = {}
    },
    createPass (record) {
      this.phonevalue = record.phone
      this.project_namevalue = record.project_name
      console.log(record)
      var create = new FormData()
      create.append('item_type', 'argument')
      create.append('item_id', record.argument_id)
      createCode(create).then(res => {
        if (res.code === 200) {
          this.code = res.result[0]
          this.passwordslice = this.code.slice(-6)
        } else {
          this.code = res.message
          this.passwordslice = this.code.slice(-6)
        }
        // this.passwordslice = this.password.slice(-6)
        console.log(this.passwordslice)
      })
      
      this.createVisible = true
    },
    createOk () {
      this.code = this.passwordslice
      const input = document.createElement('input')
      document.body.appendChild(input)
      input.setAttribute('value', this.code)
      input.select()
      if (document.execCommand('copy')) {
        document.execCommand('copy')
      }
      document.body.removeChild(input)
      this.createVisible = false
      this.$message.success('复制成功')
        console.log(1)
    },
    createCancel () {
      this.createVisible = false
    },
    handlepositive (record) {
      console.log(record)
      this.expertvisible = true
      this.expertmessage = JSON.parse(JSON.stringify(record))
      this.expertdataSource = JSON.parse(JSON.stringify(record.past_project))
    },
    handlealternative (record) {
      this.expertvisible = true
      this.expertmessage = JSON.parse(JSON.stringify(record))
      this.expertdataSource = JSON.parse(JSON.stringify(record.past_project))
    },
    handlemanual (record) {
      this.expertvisible = true
      this.expertmessage = JSON.parse(JSON.stringify(record))
      this.expertdataSource = JSON.parse(JSON.stringify(record.past_project))
    },
    detailsCancel () {
      this.expertvisible = false
      this.expertmessage = {
        my_photo: [],
        my_card_photo: [],
        academic_credentials: [],
        title_document: [],
        practice_qualification_certificate: []
      }
    },
    getTableData () {
      this.loading = true
      if (this.roleId !== 'admin') {
        this.createPassShow = false
      }
      var formdata = new FormData()
      formdata.append('current_page', this.pagination.current)
      formdata.append('per_page', this.pagination.pageSize)
      formdata.append('key_value', this.projectTypeId)
      getargumentlist(formdata).then(res => {
        // console.log(res.result)
        this.treekeys = this.treekey
        console.log(this.treekey)
        if (res.result.data.length === 0) {
          this.dataSource = []
          this.treekey = this.treekeys
        } else {
            this.treekey = res.result.data[0].argument_classify_id
            this.dataSource = res.result.data
        }
        Object.assign(this.pagination, { 'pageSize': Number(res.result.per_page), 'total': res.result.total, 'current': res.result.current_page })
      })
      setTimeout(() => {
        this.loading = false
      }, 500)
    },
    turnSmall () {
      this.tablespan === 21 ? this.tablespan = 24 : this.tablespan = 21
      this.treespan === 0 ? this.treespan = 3 : this.treespan = 0
      this.collapsed = !this.collapsed
    },
    handleModalData (record) {
      this.isRoleId = this.roleId
      this.isProjectName = this.aProjectName
      this.visible = true
      this.savestatus = true
      this.dialogTitle = '修改论证'
      this.argumentmessage = JSON.parse(JSON.stringify(record))
      this.argumentmessage.phone = Number(this.argumentmessage.phone)
      if (record.status === '审核不通过' || this.roleId === 'itemRegistration') {
        this.refusebutton = true
      } else {
        this.refusebutton = false
      }
      // 工程类别定义接口
      categorytype().then(res => {
        this.categorykind = res.result.category_type
        // this.cateid = res.result.category_type[1].category_id
        // console.log(this.cateid)
        // console.log(res.result)
      })
    },
    handleQRCode () {
    },
    adopt () {
      this.confirmLoading = true
      var formdatapass = new FormData()
      formdatapass.append('argument_id', this.argumentmessage.argument_id)
      formdatapass.append('status', '审核通过')
      console.log(this.argumentmessage.argument_id)
      modstatus(formdatapass).then(res => {
        if (res.message === 'success') {
          this.$message.success('审核通过')
        } else {
          this.$message.success(res.message)
        }
      })
      setTimeout(() => {
        this.confirmLoading = false
        this.getTableData()
        this.handleModalClose()
      }, 500)
    },
    refuse () {
      this.confirmLoading = true
      var formdatarefuse = new FormData()
      formdatarefuse.append('argument_id', this.argumentmessage.argument_id)
      formdatarefuse.append('status', '审核不通过')
      modstatus(formdatarefuse).then(res => {
        if (res.message === 'success') {
          this.$message.success('审核不通过')
        } else {
          this.$message.success(res.message)
        }
      })
      setTimeout(() => {
        this.confirmLoading = false
        this.getTableData()
        this.handleModalClose()
      }, 500)
    },
    handleModalClose () {
      this.visible = false
      this.argumentmessage = {}
    },
    handleModalOk () {
      this.isRoleId = this.roleId
      console.log('账号类型isRoleId：' + this.isRoleId)
      this.isProjectName = this.aProjectName
      console.log('工程名称isProjectName：' + this.aProjectName)
      if (this.isRoleId === 'itemRegistration') {
        this.argumentmessage.project_name = this.isProjectName
        console.log(this.argumentmessage.project_name)
      }
      this.$refs.argumentmessage.validate(valid => {
        if (!valid) {
          return false
        } else {
          this.confirmLoading = true
          if (!this.savestatus) {
            console.log(this.treekey)
            var formdataagrument = new FormData()
            formdataagrument.append('argument_classify_id', parseInt(this.treekey))
            formdataagrument.append('argument_num', this.argumentmessage.argument_num)
            formdataagrument.append('people_name', this.argumentmessage.people_name)
            formdataagrument.append('phone', this.argumentmessage.phone)
            formdataagrument.append('project_name', this.argumentmessage.project_name)
            formdataagrument.append('category_id', this.argumentmessage.category_id)
            formdataagrument.append('construction_unit', this.argumentmessage.construction_unit)
            formdataagrument.append('supervision_unit', this.argumentmessage.supervision_unit)
            formdataagrument.append('bulid_unit', this.argumentmessage.bulid_unit)
            formdataagrument.append('project_site', this.argumentmessage.project_site)
            formdataagrument.append('entrust_time', (new Date(this.argumentmessage.entrust_time)).getTime() / 1000)
            addargumentmess(formdataagrument).then(res => {
              if (res.message === 'success') {
                this.accountpassword = res.result
                this.visible = false
                this.$message.success('添加成功')
                this.handleModalClose()
              } else {
                alert(res.message)
              }
            })
          } else {
            var formdataagrumentmod = new FormData()
            formdataagrumentmod.append('argument_classify_id', parseInt(this.treekey))
            formdataagrumentmod.append('argument_num', this.argumentmessage.argument_num)
            formdataagrumentmod.append('people_name', this.argumentmessage.people_name)
            formdataagrumentmod.append('phone', this.argumentmessage.phone)
            formdataagrumentmod.append('project_name', this.argumentmessage.project_name)
            formdataagrumentmod.append('category_id', this.argumentmessage.category_id)
            formdataagrumentmod.append('construction_unit', this.argumentmessage.construction_unit)
            formdataagrumentmod.append('supervision_unit', this.argumentmessage.supervision_unit)
            formdataagrumentmod.append('bulid_unit', this.argumentmessage.bulid_unit)
            formdataagrumentmod.append('project_site', this.argumentmessage.project_site)
            formdataagrumentmod.append('entrust_time', (new Date(this.argumentmessage.entrust_time)).getTime() / 1000)
            formdataagrumentmod.append('argument_id', this.argumentmessage.argument_id)
            if (this.optionjugde === 'notverify') {
              var agrumentstamod = new FormData()
              agrumentstamod.append('argument_id', this.argumentmessage.argument_id)
              agrumentstamod.append('status', '未审核')
              modstatus(agrumentstamod)
            }
            saveargumentmess(formdataagrumentmod).then(res => {
              if (res.message === 'success') {
                this.visible = false
                this.$message.success('修改成功')
                this.argumentmessage = {}
              } else {
                alert(res.message)
              }
            })
          }
          setTimeout(() => {
            this.confirmLoading = false
            this.getTableData()
          }, 500)
        }
      })
    }
  }
})
</script>

<style lang="less" scoped>
  /deep/ .ant-modal-content{
    width: 150%;
    left: -24%;
  }
  .img-onlyRead{
    pointer-events: none;
  }
  .size_p{
    font-size: 20px;
    margin: 5px;
  }
  .title_h{
    font-size: 20px;
    font-weight: 600;
  }
  .title_d{
    font-size: 18px;
  }
  .size_h{
    font-size: 20px;
    margin: 5px;
  }
  .scroll{
    width: 100%;
    display:inline-block;
    // font-size: 0;
  }

  .scroll-interior{
    overflow-y:scroll;
    overflow-x:hidden;
    width: 140px ;
    height: 365px;
  }
  .body{
    height: 180px;
    display: flex;
    // justify-content:left;
    align-items:flex-start;
    margin:8px;

  }
  .add{
    width: 500px;
    display: flex;
    // justify-content:center;
    // align-content:center;
    flex-wrap:wrap;
    line-height: 1.8;
    margin-top: -12px;
  }
  
  h1, h2 {
  font-weight: normal;
  }
  ul {
  list-style-type: none;
  padding: 0;
  }
  li {
  display: inline-block;
  margin: 0 10px;
  }
  tr,th{
  text-align:center;
  }
</style>
